<!DOCTYPE html>
<html lang="en">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" />
	<meta name="format-detection" content="telephone=no" />
	<meta name="format-detection" content="email=no" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Cache-Control" content="no-cache" />
	<meta http-equiv="Expires" content="0" />
    <title>报告详情</title>
    <!-- 引入样式文件 -->
    <link rel="stylesheet" href="../../common/css/common.css" />
    <link rel="stylesheet" href="../../common/css/vant-index.css" />
    <link rel="stylesheet" href="../css/monitor.css">
    <link rel="stylesheet" href="../css/record.css">
    <style type="text/css">
    		.van-tabs__line{
    			background: #E22E30;
    		}
    		.van-cell{
    			padding: 10px 0;
    		}
    		.van-cell__title{
    			color: rgba(0,0,0,0.65);
    		}
    </style>

    

</head>

<body>
    <div id="app" v-cloak>
    		<van-nav-bar title="报告详情" left-text="返回" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
			<template #right>
		    		<van-icon name="wap-home-o" size='18' />
			</template>
		</van-nav-bar>
		
		<div class="rd_title flex">
			<span>{{recordName}}</span>
			<span class="rd_title_time">报告时间：{{recordTime}}</span>
		</div>
		
		<div class="shadow">
			<van-tabs v-model:active="active">
				<van-tab key='1' title="患者档案">
					<basic-info :patient-archive = 'patientArchive'></basic-info>
				</van-tab>
				<van-tab key='2' title="量表评估">
					<evalution :patient-evaluation = 'patientEvaluation'></evalution>
				</van-tab>
				<van-tab key='3' title="逆转方案">
					<reverse :patient-reverse-scheme = 'patientReverseScheme'></reverse>
				</van-tab>
			</van-tabs>
		</div>
    	</div>
</body>
<!-- 引入 rem -->
<script src="../../common/js/rem.js"></script>
<!-- 上线环境用 -->
<script src="../../common/js/vue.global.prod.js"></script>
<!-- 引入 UI 组件库 -->
<script src="../../common/js/vant.min.js"></script>
<!-- axios 接口调用 -->
<script src="../../common/js/axios.min.js"></script>
<script src="../../base.js"></script>
<script src="../../common/js/url.min.js"></script>
<script type="module">
    import {
        getAction,
        postAction,
        getUrl,
        spliceUrl,
    } from "../../common/js/api/vue3-axios-utils.js";

	import {basicInfo} from "../js/healthRecordTemplate/basicInfo.js"
	import {evalution} from "../js/healthRecordTemplate/evalution.js"
	import {reverse} from "../js/healthRecordTemplate/reverse.js"
	
    const PatientData = {

        data() {
            return {
                url: {
                    getRecord: "/patient/report/first",
                },
				patientArchive:[],
				patientEvaluation:[],
				patientReverseScheme:[],
				active:'',
				recordName:'',
				recordTime:''
            }
        },
        created() {
            this.init()
        },
        methods: {
            async init () {
                await this.handleGetRecord()
            },
            handleGetRecord () {
                getAction(spliceUrl(this.url.getRecord), { patientId: localStorage.pid}).then((res) => {
                    res = res.data
                    console.log(res)
                    if (res.success) {
                        this.patientArchive = res.result.patientArchive
                        this.patientEvaluation = res.result.patientEvaluation
                        this.patientReverseScheme = res.result.patientReverseScheme
                        this.recordTime = res.result.reportCreateTime
                        this.recordName = res.result.reportName
                        console.log('111',this.recordName,this.recordTime)
                    }
                    
                })
            },
            onClickLeft() {
		    		window.location.href='../report.html'
		    },
		    onClickRight() {
		    		window.location.href='../index.html?userid='+localStorage.pid
		    }
        },
        components: {
        		basicInfo:basicInfo,
        		evalution:evalution,
        		reverse:reverse
        }
    };

	const app = Vue.createApp(PatientData);
	
    app.use(vant);

    app.use(vant.Lazyload);

    app.mount('#app');
</script>

</html>
